/*!
 * ---------------------------------------------------------------------
 *
 * GLPI - Gestionnaire Libre de Parc Informatique
 *
 * http://glpi-project.org
 *
 * @copyright 2015-2025 Teclib' and contributors.
 * @copyright 2003-2014 by the INDEPNET Development Team.
 * @licence   https://www.gnu.org/licenses/gpl-3.0.html
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * ---------------------------------------------------------------------
 */

.form-renderer {
    /* Keep a bit of space at the end */
    margin-bottom: 200px;

    /* Remove margin from tinymce generated content last child */
    .form-description, .section-description, .block-description {
        p:last-child {
            margin-bottom: 0 !important;
        }
    }

    .fileupload {
        margin: 0;
    }

    .only-uploaded-files {
        .fileupload_info {
            margin-bottom: 0;

            p:first-child {
                margin-top: 10px;
            }

            p:last-child {
                margin-bottom: 0;
            }
        }
    }

    [data-glpi-form-renderer-horizontal-blocks] {
        display: flex;
        flex-wrap: wrap;
        gap: 0 0.5rem;

        &:not(:last-of-type) {
            // Apply the margin on the items instead of the row itself, to make
            // sure it doesn't take space when all the items inside of the row
            // are hidden by the condition engine.
            section:last-of-type {
                margin-bottom: 1rem;
            }
        }

        &:has(> :nth-child(2)) {
            &> section {
                margin-bottom: 0 !important;

                .col-12.col-sm-6 {
                    width: 100%;
                }
            }
        }
    }

    // Special tag used to mark an item as hidden by the condition engine.
    // It is safer than directly interacting the "display: none" class as it might
    // conflict with other features that hide items like the section pagination.
    [data-glpi-form-renderer-hidden-by-condition] {
        display: none;
    }
}
